package CodeBlock;

public class Move {
    private String move_name;
    private double price;
    private String director;

    // 下面的构造器都有相同的构造器，因此把构造器中相同的代码放入代码块
    {   // 此时，不管调用哪个构造器创建对象，都会首先先代用代码块的内容
        System.out.println("电影屏幕打开...");
        System.out.println("广告开始...");
        System.out.println("电影开始...");
    }

    public Move() {
        System.out.println("Move()被调用");
    }

    public Move(String move_name) {
        this.move_name = move_name;
        System.out.println("Move(String move_name)被调用");
    }

    public Move(String move_name, double price) {
        this.move_name = move_name;
        this.price = price;
        System.out.println("Move(String move_name, double price)被调用");
    }

    public Move(String move_name, double price, String director) {
        this.move_name = move_name;
        this.price = price;
        this.director = director;
        System.out.println("Move(String move_name, double price, String director)被调用");
    }
}
